<!doctype html>
<html class="no-js">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>YGBOOK后台管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="__PUBLIC__/css/amazeui.min.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/admin.css">
    <!--[if lt IE 9]>
	<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
	<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
	<script src="/js/amazeui.ie8polyfill.min.js"></script>
	<![endif]-->

    <!--[if (gte IE 9)|!(IE)]><!-->
    <script src="__PUBLIC__/js/jquery.min.js"></script>
    <!--<![endif]-->
    <script type="text/javascript">
        function checkdel() {
            if (confirm("是否确定删除?")) {
                return true;
            } else {
                return false;
            }
        }

        function gotype(obj) {
            var type = obj.value;
            if (type != 'all') {
                window.location.href = "{:U('index/article', array('cate' => '__string__'))}".replace('__string__', type);
            } else {
                window.location.href = "{:U('index/article')}";
            }
        }

        function gopick(obj) {
            var type = obj.value;
            locationurl = window.location.href.split('.html')[0];
            locationurl = locationurl.split('/picker')[0];
            if (type != 'all') {
                window.location.href = locationurl + '/picker/' + type;
            } else {
                window.location.href = locationurl;
            }
        }

        function goorder(obj) {
            var type = obj.value;
            locationurl = window.location.href.split('.html')[0];
            locationurl = locationurl.split('/order')[0];
            window.location.href = locationurl + '/order/' + type;
        }

        function editcategory(dir) {
            window.location.href = "{:U('extend/category', array('action' => 'edit', 'dir' => '__string__'))}".replace('__string__', dir);
        }

        function editpick(name) {
            window.location.href = "{:U('index/pick', array('action' => 'edit', 'name' => '__string__'))}".replace('__string__', name);
        }

        function testpick(name) {
            window.location.href = "{:U('index/pick', array('action' => 'test', 'name' => '__string__'))}".replace('__string__', name);
        }

        function editdataarea(did, domain) {
            window.location.href = "{:U('extend/dataarea', array('action' => 'edit', 'did' => '__string1__', 'domain' => '__string2__'))}".replace('__string1__', did).replace('__string2__', domain);
        }

        function delline(id) {
            if (confirm("删除后需要保存才会生效")) {
                $('#area_' + id).hide();
                $('#popen_' + id).val('deleted');
            } else {
                return false;
            }
        }

        function runpick(name) {
            var staturl = "{:U('index/pick', array('action' => 'runpick'))}";
            $.ajax({
                type: 'GET',
                url: staturl,
                data: 'id=' + name,
                dataType: 'json',
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert(XMLHttpRequest.status);
                    alert(XMLHttpRequest.readyState);
                    alert(textStatus);
                },
                success: function(json) {
                    alert('采集成功');
                }
            });
        }

        function exportpick(name) {
            window.location.href = "{:U('index/pick', array('action' => 'export', 'name' => '__string__'))}".replace('__string__', name);
        }

        function addzhanqun() {
            $('#addarea').html($('#addarea').html() + $('#codearea').html());
        }

        function addline(id, codeid) {
            $('#' + id).html($('#' + id).html() + $('#' + codeid).html());
        }

        function clearcache(id) {
            if (id == 'article') {
                var aid = prompt('请输入文章ID');
                if (!aid) {
                    alert('输入有误');
                    return false;
                }
            }
            if (confirm("确认清除吗？")) {
                if (!aid) {
                    window.location.href = "{:U('extend/cache', array('action' => 'clear', 'id' => '__string__'))}".replace('__string__', id);
                } else {
                    window.location.href = "{:U('extend/cache', array('action' => 'clear', 'id' => '__string1__', 'aid' => '__string2__'))}".replace('__string1__', id).replace('__string2__', aid);
                }
            } else {
                return false;
            }
        }
    </script>
    <style>
        .am-form select {
            font-size: 1.3rem;
        }
    </style>
</head>

<body>
    <header class="am-topbar admin-header">
        <div class="am-topbar-brand">
            <strong>YGBOOK</strong> / <small>后台管理</small>
        </div>

        <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

        <div class="am-collapse am-topbar-collapse" id="topbar-collapse">
            <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
                <li><a href="{:C('HOME_URL')}" target="_blank"><span class="am-icon-home"></span> 网站首页</a></li>
                <li><a href="__SELF__"><span class="am-icon-user"></span> 后台首页</a></li>
                <li><a href="{:U('logout')}"><span class="am-icon-sign-out"></span> 退出</a></li>
                <li class="am-hide-sm-only"><a href="javascript:;" id="admin-fullscreen"><span class="am-icon-arrows-alt"></span> <span class="admin-fullText">开启全屏</span></a></li>
            </ul>
        </div>
    </header>

    <div class="am-cf admin-main">
        <!-- sidebar start -->
        <div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
            <div class="am-offcanvas-bar admin-offcanvas-bar">
                <ul class="am-list admin-sidebar-list">
                    <li><a href="{:U('index/index')}" {$active.index}><span class="am-icon-home"></span> 首页</a></li>
                    <li><a href="{:U('index/setting')}" {$active.setting}><span class="am-icon-cog"></span> 基础设置</a></li>
                    <li><a href="{:U('index/article')}" {$active.article}><span class="am-icon-table"></span> 文章列表</a></li>
                    <li><a href="{:U('index/pick')}" {$active.pick}><span class="am-icon-cogs"></span> 采集设置</a></li>
                    <li class="admin-parent">
                        <a class="am-cf" data-am-collapse="{target: '#collapse-nav'}"><span class="am-icon-sitemap"></span> 更多功能 <span class="am-icon-angle-right am-fr am-margin-right"></span></a>
                        <ul class="am-list am-collapse admin-sidebar-sub {$amin}" id="collapse-nav">
                            <li><a href="{:U('extend/category')}" {$active.category}><span class="am-icon-list-ol"></span> 栏目设置</a></li>
                            <li><a href="{:U('extend/dataarea')}" {$active.dataarea}><span class="am-icon-database"></span> 数据区块</a></li>
                            <li><a href="{:U('extend/searchlog')}" {$active.searchlog}><span class="am-icon-search"></span> 搜索记录</a></li>
                            <li><a href="{:U('extend/tags')}" {$active.tags}><span class="am-icon-tag"></span> 标签列表</a></li>
                            <li><a href="{:U('extend/seowords')}" {$active.seowords}><span class="am-icon-cogs"></span> 关键词管理</a></li>
                            <li><a href="{:U('extend/advertise')}" {$active.advertise}><span class="am-icon-yelp"></span> 广告位管理</a></li>
                            <li><a href="{:U('extend/pickers')}" {$active.pickers}><span class="am-icon-cube"></span> 节点库</a></li>
                        </ul>
                    </li>
                    <li><a href="{:U('extend/spider')}" {$active.spider}><span class="am-icon-bug"></span> 蜘蛛记录</a></li>
                    <li><a href="{:U('extend/cache')}" {$active.cache}><span class="am-icon-retweet"></span> 缓存管理</a></li>
                </ul>
                <div class="am-panel am-panel-default admin-sidebar-panel">
                    <div class="am-panel-bd">
                        <p><span class="am-icon-bookmark"></span> 公告</p>
                        <p>感谢您使用YGBOOK！</p>
                    </div>
                </div>
            </div>
        </div>
        <!-- sidebar end -->

        <!-- content start -->
        <div class="admin-content">
            {__CONTENT__}
        </div>
        <!-- content end -->

    </div>

    <a href="#" class="am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}">
        <span class="am-icon-btn am-icon-th-list"></span>
    </a>

    <footer>
        <hr>
        <p class="am-padding-left">© {$Think.const.NOW_TIME|date='Y',###} YGBOOK, Inc. 感谢使用！感谢选择！</p>
    </footer>
    <script src="__PUBLIC__/js/amazeui.min.js"></script>
</body>

</html>